package cn.topevery.garden.entity.po;

import cn.topevery.garden.entity.serializer.GeometrySerializer;
import cn.topevery.garden.framework.base.BaseEntity;
import com.alibaba.fastjson.annotation.JSONField;
import hw.topevery.framework.annotation.DbTable;
import hw.topevery.framework.annotation.DbTableField;
import hw.topevery.framework.enums.DbTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.locationtech.jts.geom.Geometry;

import java.util.List;

@Data
@DbTable(tableName = "t_point")
public class Point extends BaseEntity {
    @DbTableField(columnName = "c_point_id", dbType = DbTypeEnum.VARCHAR)
    public String pointId;

    @DbTableField(columnName = "c_distract_id", dbType = DbTypeEnum.VARCHAR)
    public String distractId;

    @DbTableField(columnName = "c_distract_name", dbType = DbTypeEnum.VARCHAR)
    public String distractName;

    @DbTableField(columnName = "c_road_id", dbType = DbTypeEnum.VARCHAR)
    public String roadId;

    @DbTableField(columnName = "c_road_name", dbType = DbTypeEnum.VARCHAR)
    public String roadName;

    @DbTableField(columnName = "c_section_id", dbType = DbTypeEnum.VARCHAR)
    public String sectionId;

    @DbTableField(columnName = "c_section_name", dbType = DbTypeEnum.VARCHAR)
    public String sectionName;

    @DbTableField(columnName = "c_gre_measure", dbType = DbTypeEnum.DOUBLE)
    public Double greMeasure;

    @DbTableField(columnName = "c_tree_number", dbType = DbTypeEnum.INTEGER)
    public Integer treeNumber;

    @DbTableField(columnName = "c_protect_level", dbType = DbTypeEnum.INTEGER)
    public Integer protectLevel;

    @DbTableField(columnName = "c_status", dbType = DbTypeEnum.INTEGER)
    public Integer status;

    @DbTableField(columnName = "c_point_num", dbType = DbTypeEnum.VARCHAR)
    public String pointNum;

    /**
     * 范围 百度
     */
    @DbTableField(columnName = "c_map_ranges", dbType = DbTypeEnum.OTHER)
    @JSONField(serializeUsing = GeometrySerializer.class, deserializeUsing = GeometrySerializer.class)
    public Geometry mapRanges;

    /**
     * 范围 百度墨卡托
     */
    @DbTableField(columnName = "c_geom_mkt", dbType = DbTypeEnum.OTHER)
    @JSONField(serializeUsing = GeometrySerializer.class, deserializeUsing = GeometrySerializer.class)
    public Geometry geomMkt;

    /**
     * 计算空间数据
     */
    @DbTableField(columnName = "c_geo_wkt", dbType = DbTypeEnum.VARCHAR)
    public String geoWkt;

    /**
     * 所属绿地id
     */
    @DbTableField(columnName = "c_land_id", dbType = DbTypeEnum.VARCHAR)
    public Integer landId;

    @ApiModelProperty(value = "附件")
    private List <PointFile> fileList;
}
